/*
 * Wazuh vulnerability detection
 * Copyright (C) 2015, Wazuh Inc.
 * January 18, 2024.
 *
 * This program is free software; you can redistribute it
 * and/or modify it under the terms of the GNU General Public
 * License (version 2) as published by the FSF - Free Software
 * Foundation.
 */
#ifndef _MOCK_CLEAN_AGENT_INVENTORY_HPP
#define _MOCK_CLEAN_AGENT_INVENTORY_HPP

#include "MockIndexerConnector.hpp"
#include "cleanAgentInventory.hpp"
#include "gmock/gmock.h"

constexpr int CLEAN_UP_DATA_ID {6};

/**
 * @class TMockCleanAgentInventory
 *
 * @brief The `TMockCleanAgentInventory` class provides a simplified context data for unit testing.
 *
 * The `TMockCleanAgentInventory` class is intended for use in unit tests to create a mock or stub
 * implementation of context data.
 *
 * @tparam TIndexerConnector A mock or stub connector type, typically used for interfacing with
 * indexing services or databases during testing. Defaults to `MockIndexerConnector`.
 */
template<typename TIndexerConnector = MockIndexerConnector>
class TMockCleanAgentInventory : public AbstractHandler<std::shared_ptr<std::vector<int>>>
{
public:
    /**
     * @brief Construct a new Mock GlobalDbFetch object.
     * @param indexerConnector TIndexerConnector instance.
     * @param inventoryDatabase RocksDBWrapper instance for inventory storage.
     */
    TMockCleanAgentInventory(std::shared_ptr<TIndexerConnector> indexerConnector,
                             Utils::RocksDBWrapper& inventoryDatabase) {};
    virtual ~TMockCleanAgentInventory() = default;

    /**
     * @brief Handles request and passes control to the next step of the chain.
     *
     * @param data Mocked context data
     * @return std::shared_ptr<std::vector<int>>
     */
    std::shared_ptr<std::vector<int>> handleRequest(std::shared_ptr<std::vector<int>> data) override
    {
        data->push_back(CLEAN_UP_DATA_ID);
        return AbstractHandler<std::shared_ptr<std::vector<int>>>::handleRequest(std::move(data));
    }
};

using MockCleanUpData = TMockCleanAgentInventory<>;

#endif // _MOCK_CLEAN_AGENT_INVENTORY_HPP
